<!--#include virtual="/Common/Config.asp" -->
<!--#include file="Check_Login.asp" -->
<!--#include virtual="/Common/conn.asp" -->
<!--#include virtual="/Common/Function.asp" -->
<%
Dim PI_ID		
Dim PI_Title	
Dim PI_Desc                
Dim PI_Type		
Dim PI_Area                
                
Dim PI_Link		
Dim PI_Address	
Dim PI_Tel		
Dim PI_Email	
Dim PI_Website	
Dim PI_QQ		
                
                
Dim PI_IsAudit	
Dim PI_IsTop	
Dim PI_IP		
                

Dim Update_Name		
Dim Update_Date	
%>
<%
Sub Left_Menu1() 
%>
      		<h3>供求信息</h3>
            <div>
                <ul>
					<li><a href="Gq_Info_Post.asp">发布信息</a></li>
                    <li><a href="Gq_Info_List.asp">供求信息</a></li>
                </ul>
            </div>

	  <% If Session("Member_Type")="个人" Then %>
      		<h3>家政管理</h3>
            <div>
                <ul>
                    <li><a href="#">找 家 政</a></li>
                    <li><a href="#">做 家 政</a></li>
                </ul>
            </div>
      		<h3>求职管理</h3>
            <div>
                <ul>
                    <li><a href="QZ_Post.asp">个人简历</a></li>
                    <li><a href="#">求职信息</a></li>
                </ul>
            </div>
	  <% End If %>
	  <% If Session("Member_Type")="企业" Then %>

            <h3>家政管理</h3>
            <div>
                <ul>
                    <li><a href="#">供应家政</a></li>
                    <li><a href="#">家政订单</a></li>
                </ul>
            </div>
      		<h3>招聘管理</h3>
            <div>
                <ul>
                    <li><a href="Corp_Job_Post.asp">发布招聘</a></li>
                    <li><a href="Corp_Job_List.asp">招聘列表</a></li>
                </ul>
            </div>
      		<h3>企业人才</h3>
            <div>
                <ul>
                    <li><a href="Corp_Person_Post.asp">增加人才</a></li>
                    <li><a href="Corp_Person_List.asp">人才列表</a></li>
                </ul>
            </div>            <h3>优惠信息</h3>
            <div>
                <ul>
                    <li><a href="Corp_Sale_News_Post.asp">发布优惠</a></li>
                    <li><a href="Corp_Sale_News_List.asp">优惠列表</a></li>
                </ul>
            </div>

	  <% End If %>
<% End Sub %>	

<%
Sub Left_Menu2()
%>
			<h3>问答管理</h3>
            <div>
                <ul>
                    <li><a href="#">发起问答</a></li>
                    <li><a href="#">问答列表</a></li>
                </ul>
            </div>
      		<h3>基本设置</h3>
            <div>
                <ul>
				  <% If Session("Member_Type")="个人" Then %>
                  <li><a href="Member_Info.asp">基本资料</a></li>
                  <% Else %>
                  <li><a href="Corp_Post.asp">商家资料</a></li>
                  <% End If %>
                  <li><a href="Member_Change.asp">修改密码</a></li>
                  <li><a href="Member_Logout.asp">退出登录</a></li>
                </ul>
            </div>
<% End Sub %>

<%
'密码修改
Sub Update_Member_Pass()

	Pass	= request.form("Pass")
	Pass1	= request.form("Pass1")
	Pass2	= request.form("Pass2")

	Call Check_Length(Pass,20,1,"旧密码")	
	Call Check_Length(Pass1,20,1,"新密码")	
	Call Check_Length(Pass2,20,1,"重复输入的新密码")	

	If Pass1<>Pass2 Then 
		AlertBox "两次输入的新密码不一致!","javascript:history.go(-1)"
	End If
	
	UserPassword = Get_FirstValue("SELECT UserPassword FROM Member WHERE UserName = '" &Session("UserName") &"'")

	If UserPassword<>MD5(Pass) Then 
		AlertBox "输入的旧密码不正确!","javascript:history.go(-1)"
	End If
	

	sql = "UPDATE Member SET " &_
		  " UserPassword	= '"&MD5(Pass1) &"'" &_
		  " WHERE UserName = '" & Session("UserName") &"'"
	
	conn.execute(sql)

			 	
	AlertBox "密码修改成功!","Member_Change.asp"


End Sub

'取会员信息
Dim Email			
Dim TrueName		
Dim Tel				
Dim Photo			
Dim Age				
Dim Sex				

Sub Get_Member_Info()
	
	sql = "SELECT * FROM Member_Personal WHERE UserName = '" &Session("UserName") &"'"
	
	Set rsTemp = conn.execute(sql)
	
	If Not rsTemp.eof Then
		Email = rsTemp("Email")			
		TrueName = rsTemp("TrueName")		
		Tel = rsTemp("Tel")				
		Photo = rsTemp("Photo")			
		Age = rsTemp("Age")				
		Sex = rsTemp("Sex")				
		Address = rsTemp("Address")		
		else
		response.Write("ssss")	
	End If 
End Sub 

'会员信息修改
Sub Update_Member_Info()

	Email = Reform("Email")			
	TrueName = Reform("TrueName")		
	Tel = Reform("Tel")				
	Photo = Reform("Photo")			
	Age = Reform("Age")				
	Sex = Reform("Sex")				
	Address = Reform("Address")			
	
	Sql = "SELECT * From Member_Personal WHERE UserName = '" &Session("UserName") &"'"
	Array_List = GetRsRows(Sql)
	If IsArray(Array_List) Then 
 
		sql = "UPDATE Member_Personal SET " &_
			" Email='"&Email&"'"&_			
			",TrueName='"&TrueName&"'"&_		
			",Tel='"&Tel&"'"&_				
			",Photo='"&Photo&"'"&_			
			",Age='"&Age&"'"&_				
			",Sex='"&Sex&"'"&_				
			",Address='"&Address&"'"&_			
			" WHERE UserName = '" &Session("UserName") &"'"
	Else
		Sql = "INSERT INTO Member_Personal( "&_
			" UserName"&_			
			",Email"&_			
			",TrueName"&_		
			",Tel"&_				
			",Photo"&_			
			",Age"&_				
			",Sex"&_				
			",Address"&_
			") VALUES("&_
			"'"&Session("UserName")&"'"&_			
			",'"&Email&"'"&_			
			",'"&TrueName&"'"&_		
			",'"&Tel&"'"&_				
			",'"&Photo&"'"&_			
			",'"&Age&"'"&_				
			",'"&Sex&"'"&_				
			",'"&Address&"'"&_
			")"

	End If 

	On Error Resume Next 

	conn.execute(sql)

	If Err.number=0 Then 		 	
		AlertBox "信息修改成功!","Member_Info.asp"
	Else
		AlertBox "信息修改失败,请检查数据后再提交!","javascript:history.go(-1)"


	End If 


End Sub

'黄页发布
Sub YP_Post()
	Corp_Name = reform("Corp_Name")
	Products = reform("Products")
	YP_ID = reform("YP_ID")
	YPS_ID = reform("YPS_ID")
	YPI_Area = reform("YPI_Area")
	Link = reform("Link")
	address = reform("address")
	tel = reform("tel")
	email = reform("email")
	website = reform("website")
	Content = reform("Content")

	Update_Name = Session("username")
	Update_Date = Now()
	YI_sAudit = 0

	sql = "INSERT INTO YellowPage_Info( " &_
		"YPI_Corp_Name " &_

		",YP_ID " &_
		",YPS_ID " &_

		",YPI_Area		" &_

		",YPI_Link		" &_
		",YPI_Address	" &_
		",YPI_Tel		" &_ 
		",YPI_Email		" &_
		",YPI_Website	" &_

		",YPI_Products	" &_
		",YPI_Content	" &_

		",YPI_IsAudit	" &_

		",Update_Name	" &_
		",Update_Date	" &_

		") VALUES( " &_
		" '" & Corp_Name & "'" &_

		"," & YP_ID &_
		"," & YPS_ID &_

		",'" & YPI_Area & "'" &_

		",'" & Link & "'" &_
		",'" & Address & "'" &_
		",'" & Tel & "'" &_
		",'" & YEmail & "'" &_
		",'" & Website & "'" &_

		",'" & Products & "'" &_
		",'" & Content  & "'" &_

		"," & YI_sAudit &_

		",'"&Update_Name&"'"&_
		",'"&Update_Date&"'"&_
		")"

	'writebr sql
	On Error Resume Next

    conn.execute(sql)

	if err.number =0 then  
		AlertBox "黄页信息增加成功！","Index.asp"
	else 
		AlertBox "黄页信息增加失败！","javascript:history.go(-1)"
	end if
End Sub 

'个人信息发布
Sub Info_Post()
	info_title = reform("info_title")
	Info_Desc  = reform("Info_Desc")

	Info_Area = reform("Info_Area")
	Info_Type = reform("Info_Type")

	linkMan = reform("linkMan")
	linkMode = reform("linkMode")
	linkAdd = reform("linkAdd")

	Update_Name = Session("username")
	Update_Date = Now()
	sql = "INSERT INTO Person_Info( " &_
		"PI_Title " &_
		",PI_Desc " &_

		",PI_Type " &_
		",PI_Area " &_


		",PI_Link		" &_
		",PI_Email		" &_
		",PI_Address	" &_

		",PI_IP" &_
		",Update_Name	" &_
		",Update_Date	" &_

		") VALUES( " &_

		" '" & info_title & "'" &_
		",'" & Info_Desc & "'" &_

		",'" & Info_Type & "'" &_
		",'" & Info_Area & "'" &_

		",'" & linkMan & "'" &_
		",'" & linkMode & "'" &_
		",'" & linkAdd & "'" &_

	
		",'"&get_clientip&"'"&_
		",'"&Update_Name&"'"&_
		",'"&Update_Date&"'"&_
		")"

	'writebr sql
	'On Error Resume Next

    conn.execute(sql)

	if err.number =0 then  
		AlertBox "信息发布成功！","Index.asp"
	else 
		AlertBox "信息发布失败！","javascript:history.go(-1)"
	end if
End Sub 
Sub Get_Info()	

	PI_ID = requery("Info_ID")

	Call Check_IsNumeric(PI_ID)

	sql = "SELECT * FROM Person_Info WHERE PI_ID = " &PI_ID &" AND Update_Name='"&Session("username")&"'"
	
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		PI_ID		= rs("PI_ID")		
		PI_Title	= rs("PI_Title")
		PI_Desc		= rs("PI_Desc")
						
		PI_Type		= rs("PI_Type")		
		PI_Area		= rs("PI_Area")		
						
						
		PI_Link		= rs("PI_Link")		
		PI_Address	= rs("PI_Address")	
		PI_Tel		= rs("PI_Tel")		
		PI_Email	= rs("PI_Email")	
		PI_Website	= rs("PI_Website")	
		PI_QQ		= rs("PI_QQ")		
						
						
		PI_IsAudit = rs("PI_IsAudit")	
		PI_IsTop	= rs("PI_IsTop")	
		PI_IP		= rs("PI_IP")		
						
		Update_Name = rs("Update_Name")
		Update_Date = rs("Update_Date")
	End If

End Sub 
Sub Person_Info_Edit()
	PI_ID = Reform("Info_ID")
	Call Check_IsNumeric(PI_ID)
	PI_Title	= reform("info_title")	
	PI_Desc		= reform("Info_Desc")                
	PI_Type		= reform("Info_Type")		
	PI_Area		= reform("Info_Area")                
				
	PI_Link		= reform("linkMan")		
	PI_Address	= reform("linkAdd")	
	PI_Tel		= reform("linkMode")		
	PI_Email	= reform("PI_Email")	
	PI_Website	= reform("PI_Website")	
	PI_QQ		= reform("PI_QQ")	
	
	Update_Date	= now()

	Sql = "UPDATE Person_Info SET "&_
		"PI_Title='"&PI_Title&"'"&_
		",PI_Desc='"&PI_Desc&"'"&_            
		",PI_Type='"&PI_Type&"'"&_
		",PI_Area='"&PI_Area&"'"&_           
					
		",PI_Link='"&PI_Link&"'"&_
		",PI_Address='"&PI_Address&"'"&_
		",PI_Tel='"&PI_Tel&"'"&_
		",PI_Email='"&PI_Email&"'"&_
		",PI_Website='"&PI_Website&"'"&_
		",PI_QQ='"&PI_QQ&"'"&_
		",Update_Date='"&Update_Date&"'"&_
		" WHERE PI_ID="&PI_ID &_
		 "AND Update_Name='"&Session("username")&"'"
    conn.execute(sql)

	AlertBox "修改成功！","index.asp"

End Sub 
Sub Person_Info_Del()

	Info_ID = Requery("Info_ID")
	Call Check_IsNumeric(Info_ID)

	sql = "DELETE FROM  Person_Info WHERE PI_ID = "&Info_ID &" AND Update_Name='"&Session("username")&"'"

    conn.execute(sql)

	AlertBox "删除成功","index.asp"

End Sub 


Dim	YPI_ID		
Dim	YPI_Corp_Name		'--公司名称
Dim YPI_Pic				'--公司图片

Dim YP_ID				'--大类
Dim YPS_ID				'--小类

Dim YPI_Area			'--地区

Dim YPI_Link			'--联系人
Dim YPI_Address			'--地址
Dim YPI_Tel				'--电话
Dim YPI_Email			'--邮件地址
Dim YPI_Website			'--网址


Dim YPI_Products		'--产品和服务
Dim YPI_Content			'--简介

Dim YPI_IsAudit			'--是否通过审核
Dim YPI_IsTop			'--是否置顶

Sub Get_YellowPage_Info()
	YPI_ID = requery("Info_ID")

	Call Check_IsNumeric(YPI_ID)


	sql = "SELECT * FROM YellowPage_Info WHERE YPI_ID = "&YPI_ID
	
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		YPI_ID			=rs("YPI_ID")
		YPI_Corp_Name	=rs("YPI_Corp_Name")
		YPI_Pic			=rs("YPI_Pic")

		YP_ID			=rs("YP_ID")
		YPS_ID			=rs("YPS_ID")

		YPI_Area	=rs("YPI_Area")

		YPI_Link	=rs("YPI_Link")
		YPI_Address	=rs("YPI_Address")
		YPI_Tel		=rs("YPI_Tel")
		YPI_Email	=rs("YPI_Email")
		YPI_Website	=rs("YPI_Website")


		YPI_Products=rs("YPI_Products")
		YPI_Content	=rs("YPI_Content")

		YPI_IsAudit	=rs("YPI_IsAudit")
		YPI_IsTop	=rs("YPI_IsTop")

		Update_Name	=rs("Update_Name")
		Update_Date	=rs("Update_Date")

	End If


End Sub

Sub YP_Del()

	Info_ID = Requery("Info_ID")
	Call Check_IsNumeric(Info_ID)

	sql = "DELETE FROM  YellowPage_Info WHERE YPI_ID = "&Info_ID &" AND Update_Name='"&Session("username")&"'"
	
    conn.execute(sql)

	AlertBox "删除成功","YP_List.asp"

End Sub 
Sub YP_Update()
	Info_ID		= reform("Info_ID") 
	Corp_Name = reform("Corp_Name")
	Products = reform("Products")
	YP_ID = reform("YP_ID")
	YPS_ID = reform("YPS_ID")
	YPI_Area = reform("YPI_Area")
	Link = reform("Link")
	address = reform("address")
	tel = reform("tel")
	email = reform("email")
	website = reform("website")
	Content = reform("Content")

	Update_Name = Session("username")
	Update_Date = Now()
	YI_sAudit = 0


	Sql = "UPDATE YellowPage_Info SET "&_
		"YPI_Corp_Name='"&Corp_Name&"'"&_
		",YP_ID='"&YP_ID&"'"&_            
		",YPS_ID='"&YPS_ID&"'"&_
		",YPI_Area='"&YPI_Area&"'"&_           
					
		",YPI_Link='"&Link&"'"&_
		",YPI_Address='"&address&"'"&_
		",YPI_Tel='"&tel&"'"&_
		",YPI_Email='"&email&"'"&_
		",YPI_Website='"&website&"'"&_
		",YPI_Products='"&Products&"'"&_
		",YPI_Content='"&Content&"'"&_
		",Update_Date='"&Update_Date&"'"&_
		" WHERE YPI_ID="&Info_ID &_
		 "AND Update_Name='"&Session("username")&"'"
    conn.execute(sql)


	On Error Resume Next

    conn.execute(sql)

	if err.number =0 then  
		AlertBox "黄页信息修改成功！","YP_List.asp"
	else 
		AlertBox "黄页信息修改失败！","javascript:history.go(-1)"
	end if
End Sub 

'个人求职信息

Dim Birthday		
Dim Nation			
Dim Location		
Dim Married			
Dim Health_Car		
                
Dim Service_Item    
Dim Service_Status	
Dim Service_Corp	
Dim Work_Year		
'Dim Tel				
Dim Education		
Dim Special			

Sub Update_QZ_Info()
	Photo = Reform("Photo")	
	Truename = Reform("Truename")		
	Sex = Reform("Sex")				
	Birthday = Reform("Birthday")		
	Nation = Reform("Nation")			
	Location = Reform("Location")		
	Married = Reform("Married")			
	Health_Car = Reform("Health_Car")		
					
	Service_Item = Reform("Service_Item")    
	Service_Status = Reform("Service_Status")	
	Service_Corp = Reform("Service_Corp")	
	Work_Year = Reform("Work_Year")		
	Tel = Reform("Tel")				
	Education = Reform("Education")		
	Special = Reform("Special")			


	Sql = "SELECT Update_Name FROM Member_Person_QZ WHERE Update_Name = '"&Session("UserName")&"'"
	Array_List = GetRsRows(Sql)
	If IsArray(Array_List) Then 
		Sql = "UPDATE Member_Person_QZ SET "&_

				" Truename = '"&Truename&"'"&_		
				",Photo = '"&Photo&"'"&_		
				", Sex = '"&Sex&"'"&_				
				",Birthday='"&Birthday&"'"&_		
				",Nation='"&Nation&"'"&_			
				",Location='"&Location&"'"&_		
				",Married='"&Married&"'"&_			
				",Health_Car='"& Health_Car&"'"&_		
								
				",Service_Item='"&Service_Item&"'"&_    
				",Service_Status='"&Service_Status&"'"&_	
				",Service_Corp='"&Service_Corp&"'"&_	
				",Work_Year='"&Work_Year&"'"&_		
				",Tel='"&Tel&"'"&_				
				",Education='"&Education&"'"&_		
				",Special='"&Special&"'"&_			

				
				", Update_Date = '"&Now()&"'"&_
				
				" WHERE Update_Name='"&Session("UserName")&"'"
	Else
		Sql = "INSERT INTO Member_Person_QZ ("&_
				"UserName"&_	
				",Update_Name"&_		
				",Truename"&_		
				",Photo"&_		
				",Sex"&_				
				",Birthday"&_		
				",Nation"&_			
				",Location"&_		
				",Married"&_			
				",Health_Car"&_		
								
				",Service_Item"&_    
				",Service_Status"&_	
				",Service_Corp"&_	
				",Work_Year"&_		
				",Tel"&_				
				",Education"&_		
				",Special"&_

				",Update_Date"&_
				

				") VALUES ("&_
				"'"&Session("UserName")&"'"&_		
				",'"&Session("UserName")&"'"&_		
				",'"&Truename&"'"&_		
				",'"&Photo&"'"&_		
				",'"&Sex&"'"&_				
				",'"&Birthday&"'"&_		
				",'"&Nation&"'"&_			
				",'"&Location&"'"&_		
				",'"&Married&"'"&_			
				",'"& Health_Car&"'"&_		
								
				",'"&Service_Item&"'"&_    
				",'"&Service_Status&"'"&_	
				",'"&Service_Corp&"'"&_	
				",'"&Work_Year&"'"&_		
				",'"&Tel&"'"&_				
				",'"&Education&"'"&_		
				",'"&Special&"'"&_			


				",'"&Now()&"'"&_
				")"
		
	End If 
	'writebr Service_Item
	'endd
	Conn.BeginTrans
	On Error Resume Next

	conn.execute(Sql)
	Call Update_Service_Item(Session("UserName"),Service_Item)
	If  err.number =0 Then   
		conn.CommitTrans  
		AlertBox "更新成功！","QZ_Post.asp"
	Else  
		conn.RollbackTrans 
		AlertBox "更新失败！","QZ_Post.asp"
	End If 

End Sub 


	

Sub Get_QZ_Info()
	Sql = "SELECT * FROM Member_Person_QZ  WHERE UserName='"&Session("UserName")&"'"
	Set rs = conn.execute(Sql)
	If Not rs.Eof Then 
		Truename = rs("Truename")		
		Photo = rs("Photo")		
		Sex = rs("Sex")				
		Birthday = rs("Birthday")		
		Nation = rs("Nation")			
		Location = rs("Location")		
		Married = rs("Married")			
		Health_Car = rs("Health_Car")		

		Service_Item = rs("Service_Item")    
		Service_Status = rs("Service_Status")	
		Service_Corp = rs("Service_Corp")	
		Work_Year = rs("Work_Year")		
		Tel = rs("Tel")				
		Education = rs("Education")		
		Special = rs("Special")			
		
	End If 
	rs.close
End Sub 
Sub Update_Corp_Person_Info()
	Photo = Reform("Photo")	
	Truename = Reform("Truename")		
	Sex = Reform("Sex")				
	Birthday = Reform("Birthday")		
	Nation = Reform("Nation")			
	Location = Reform("Location")		
	Married = Reform("Married")			
	Health_Car = Reform("Health_Car")		
					
	Service_Item = Reform("Service_Item")    
	Service_Status = Reform("Service_Status")	
	Service_Corp = Reform("Service_Corp")	
	Work_Year = Reform("Work_Year")		
	Tel = Reform("Tel")				
	Education = Reform("Education")		
	Special = Reform("Special")			

	Corp_Person_Info_Action =reform("Corp_Person_Info_Action")
	If Corp_Person_Info_Action="update" Then 
		ID = reform("ID")
		Call Check_IsNumeric(ID)
		Corp_Person_ID = ID
		Sql = "UPDATE Corp_Person_Info SET "&_

				" Truename = '"&Truename&"'"&_		
				",Photo = '"&Photo&"'"&_		
				", Sex = '"&Sex&"'"&_				
				",Birthday='"&Birthday&"'"&_		
				",Nation='"&Nation&"'"&_			
				",Location='"&Location&"'"&_		
				",Married='"&Married&"'"&_			
				",Health_Car='"& Health_Car&"'"&_		
								
				",Service_Item='"&Service_Item&"'"&_    
				",Service_Status='"&Service_Status&"'"&_	
				",Service_Corp='"&Service_Corp&"'"&_	
				",Work_Year='"&Work_Year&"'"&_		
				",Tel='"&Tel&"'"&_				
				",Education='"&Education&"'"&_		
				",Special='"&Special&"'"&_			
				
				", Update_Date = '"&Now()&"'"&_
			
				" WHERE ID='"&ID&"' AND Corp_UserName='"&Session("UserName")&"'"
	Else
		Sql = "SET NOCOUNT ON;INSERT INTO Corp_Person_Info ("&_
				"Corp_UserName"&_	
				",Update_Name"&_		
				",Truename"&_		
				",Photo"&_		
				",Sex"&_				
				",Birthday"&_		
				",Nation"&_			
				",Location"&_		
				",Married"&_			
				",Health_Car"&_		
								
				",Service_Item"&_    
				",Service_Status"&_	
				",Service_Corp"&_	
				",Work_Year"&_		
				",Tel"&_				
				",Education"&_		
				",Special"&_

				",Update_Date"&_
				

				") VALUES ("&_
				"'"&Session("UserName")&"'"&_		
				",'"&Session("UserName")&"'"&_		
				",'"&Truename&"'"&_		
				",'"&Photo&"'"&_		
				",'"&Sex&"'"&_				
				",'"&Birthday&"'"&_		
				",'"&Nation&"'"&_			
				",'"&Location&"'"&_		
				",'"&Married&"'"&_			
				",'"& Health_Car&"'"&_		
								
				",'"&Service_Item&"'"&_    
				",'"&Service_Status&"'"&_	
				",'"&Service_Corp&"'"&_	
				",'"&Work_Year&"'"&_		
				",'"&Tel&"'"&_				
				",'"&Education&"'"&_		
				",'"&Special&"'"&_			


				",'"&Now()&"'"&_
			  ");"&_
			  "SELECT @@identity;"
		
	End If 
	'writebr Service_Item
	'endd
	Conn.BeginTrans
	'On Error Resume Next
	If Corp_Person_Info_Action="update" Then 
		conn.execute(Sql)
	Else
		Set rs_Temp = conn.execute(Sql)
		Corp_Person_ID = rs_Temp(0)
		rs_Temp.close
	End If 
	Call Corp_Person_Update_Service_Item(Corp_Person_ID,Service_Item)
	If  err.number =0 Then   
		conn.CommitTrans  
		AlertBox "更新成功！","Corp_Person_List.asp"
	Else  
		conn.RollbackTrans 
		AlertBox "更新失败！","Corp_Person_List.asp"
	End If 

End Sub 
Dim Corp_Person_Info_Action
Sub Get_Corp_Person_Info()
	ID = requery("ID")
	If IsNumeric(ID) Then 
		Corp_Person_Info_Action = "update"
		Sql = "SELECT * FROM Corp_Person_Info  WHERE ID='"&ID&"' AND Corp_UserName='"&Session("UserName")&"'"
		Set rs = conn.execute(Sql)
		If Not rs.Eof Then 
			Truename = rs("Truename")		
			Photo = rs("Photo")		
			Sex = rs("Sex")				
			Birthday = rs("Birthday")		
			Nation = rs("Nation")			
			Location = rs("Location")		
			Married = rs("Married")			
			Health_Car = rs("Health_Car")		

			Service_Item = rs("Service_Item")    
			Service_Status = rs("Service_Status")	
			Service_Corp = rs("Service_Corp")	
			Work_Year = rs("Work_Year")		
			Tel = rs("Tel")				
			Education = rs("Education")		
			Special = rs("Special")			
			
		End If 
		rs.close
	Else
		Corp_Person_Info_Action = "add"		
	End If 

End Sub 
Dim Big_ID
Dim Corp_City_Area
Dim City_ID
Dim Corp_Type
Dim Corp_Name
Dim Corp_Pic
Dim Corp_Detail		
Dim Corp_Tel		
Dim Corp_Fax		
Dim Corp_Address
Dim Corp_Address_S
Dim Corp_Open		
Dim Corp_Business	
Dim Corp_SI
Sub Get_Corp_Info()
	Sql = "SELECT * FROM Corp_Info  WHERE Corp_Username='"&Session("UserName")&"' AND Corp_Audit=1"
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		Corp_City_Area	= rs("Corp_City_Area") 
		Corp_Type       = rs("Corp_Type")
		Corp_Name		= rs("Corp_Name")
		Corp_Pic		= rs("Corp_Pic")
		Corp_Detail		= rs("Corp_Detail")
		Corp_Tel		= rs("Corp_Tel")
		Corp_Fax		= rs("Corp_Fax")
		Corp_Address	= rs("Corp_Address")
		Corp_Address_S	= rs("Corp_Address_S")
		Corp_Open		= rs("Corp_Open")
		Corp_Business	= rs("Corp_Business")
		Corp_SI			= rs("Corp_SI")

		Corp_Audit		= rs("Corp_Audit")
		Corp_Gold_Flag	= rs("Corp_Gold_Flag")

					   
		Update_Name    = rs("Update_Name")
		Update_Date    = rs("Update_Date")
	Else
		AlertBox "公司资料不完整,请与我们联系！","index.asp"
	End If
	Big_ID = Get_FirstValue("SELECT Parent_ID FROM Corp_Type WHERE ID="&Corp_Type)
	City_ID = Get_FirstValue("SELECT Parent_ID FROM City_Area WHERE ID="&Corp_City_Area)
End Sub 
Sub Update_Corp_Info()
	Big_ID = reform("Big_ID")
	Call Check_IsNumeric_Msg(Big_ID,"企业分类ID")

	Corp_Type = reform("Corp_Type")
	Call Check_IsNumeric_Msg(Corp_Type,"企业分类ID")

	City_ID = reform("City_ID")
	Call Check_IsNumeric_Msg(City_ID,"选择地区")

	Corp_City_Area = reform("Corp_City_Area")
	Call Check_IsNumeric_Msg(Corp_City_Area,"选择地区")
	
	Corp_City_Area	= reform("Corp_City_Area")	
	
	Corp_City_Area	= reform("Corp_City_Area")	
	Corp_Type		= reform("Corp_Type")	
	Corp_Name		= reform("Corp_Name")
	Corp_Pic		= reform("Corp_Pic")
	Corp_Detail		= reform("Corp_Detail")	
	Corp_Tel		= reform("Corp_Tel")	
	Corp_Fax		= reform("Corp_Fax")	
	Corp_Address	= reform("Corp_Address")	
	Corp_Address_S	= reform("Corp_Address_S")	

	Corp_Open		= reform("Corp_Open")	
	Corp_Business	= reform("Corp_Business")	
	Corp_SI			= reform("Corp_SI")	

	sql = "UPDATE Corp_Info Set " &_
		  "Corp_Type = "& Corp_Type &_
		  ",Corp_City_Area = "& Corp_City_Area &_

		  ",Corp_Name ='"&Corp_Name&"'"&_
		  ",Corp_Pic ='"&Corp_Pic&"'"&_		  
		  ",Corp_Detail ='"&Corp_Detail&"'"&_
		  ",Corp_Tel ='"&Corp_Tel&"'"&_
		  ",Corp_Fax ='"&Corp_Fax&"'"&_
		  ",Corp_Address ='"&Corp_Address&"'"&_
		  ",Corp_Address_S ='"&Corp_Address_S&"'"&_
		  ",Corp_Open ='"&Corp_Open&"'"&_
		  ",Corp_Business ='"&Corp_Business&"'"&_
		  ",Corp_SI ='"&Corp_SI&"'"&_


		  " WHERE Corp_Username='"&Session("UserName")&"'"

    conn.execute(sql)


	AlertBox "更新成功！","Corp_Post.asp"

End Sub 

'企业招聘发布
Sub Corp_Job_Post()

	Post_Type = Reform("Post_Type")		
	Post = Reform("Post")			
	Post_Desc = Reform("Post_Desc")		

	Location = Reform("Location")		
	Salary = Reform("Salary")			

	End_Date = Reform("End_Date")		

	Update_Name = Session("username")
	Post_Date = Now()

	sql = "INSERT INTO Member_Corp_Offers( " &_
		"UserName " &_
		",Post_Type"&_		
		",Post"&_			
		",Post_Desc"&_		

		",Location"&_		
		",Salary"&_			

		",End_Date"&_		
		",Post_Date"&_		

		") VALUES( " &_
		" '" & Update_Name & "'" &_

		",'"&Post_Type&"'"&_		
		",'"&Post&"'"&_			
		",'"&Post_Desc&"'"&_		

		",'"&Location&"'"&_		
		",'"&Salary&"'"&_			

		",'"&End_Date&"'"&_		
		",'"&Post_Date&"'"&_		

		")"

	'writebr sql
	'On Error Resume Next

    conn.execute(sql)

	if err.number =0 then  
		AlertBox "招聘信息增加成功！","Index.asp"
	else 
		AlertBox "招聘信息增加失败！","javascript:history.go(-1)"
	end if
End Sub 
Sub Corp_Job_Del()

	Info_ID = Requery("ID")
	Call Check_IsNumeric(Info_ID)

	sql = "DELETE FROM  Member_Corp_Offers WHERE ID = "&Info_ID &" AND UserName='"&Session("username")&"'"
	
    conn.execute(sql)

	AlertBox "删除成功","Corp_Job_List.asp"

End Sub 
Sub Corp_Person_Del()

	Info_ID = Requery("ID")
	Call Check_IsNumeric(Info_ID)

	sql = "DELETE FROM  Corp_Person_Info WHERE ID = "&Info_ID &" AND Corp_UserName='"&Session("username")&"'"
	sql = sql&";delete from Corp_Person_Service_Item WHERE Corp_Person_ID="&Info_ID
    conn.execute(sql)
	AlertBox "删除成功","Corp_Person_List.asp"

End Sub 
Dim ID
Dim Post_Type		
Dim Post			
Dim Post_Desc		

		
Dim Salary			

Dim End_Date		
Dim Post_Date		


Sub Get_Corp_Job_Info()
	ID = requery("ID")

	Call Check_IsNumeric(ID)


	sql = "SELECT * FROM Member_Corp_Offers WHERE ID = "&ID &" AND UserName='"&Session("username")&"'"
	
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		Post_Type = rs("Post_Type")		
		Post = rs("Post")			
		Post_Desc = rs("Post_Desc")		

		Location = rs("Location")		
		Salary = rs("Salary")			

		End_Date = rs("End_Date")		
		Post_Date = rs("Post_Date")		

	End If


End Sub

Sub Corp_Job_Update()
	ID		= reform("ID") 
	Call Check_IsNumeric(ID)

	Post_Type = Reform("Post_Type")		
	Post = Reform("Post")			
	Post_Desc = Reform("Post_Desc")		

	Location = Reform("Location")		
	Salary = Reform("Salary")			

	End_Date = Reform("End_Date")		

	Update_Name = Session("username")
	Post_Date = Now()


	Sql = "UPDATE Member_Corp_Offers SET "&_
		" Post_Type='"&Post_Type&"'"&_		
		",Post='"&Post&"'"&_			
		",Post_Desc='"&Post_Desc&"'"&_		

		",Location='"&Location&"'"&_		
		",Salary='"&Salary&"'"&_			

		",End_Date='"&End_Date&"'"&_		
		",Post_Date='"&Post_Date&"'"&_		
		" WHERE ID = "&ID &" AND UserName='"&Session("username")&"'"

    conn.execute(sql)


	On Error Resume Next

    conn.execute(sql)

	if err.number =0 then  
		AlertBox "招聘信息修改成功！","Corp_Job_List.asp"
	else 
		AlertBox "招聘信息修改失败！","javascript:history.go(-1)"
	end if
End Sub 
Sub Show_Corp_SI(Corp_SI)
	Array_List = GetRsRows("SELECT ID,SI_Name FROM Corp_Service_Item ORDER BY SI_Order ASC ")
	If IsArray(Array_List) Then 
		For i=0 To UBound(Array_List,2)
			Response.Write "<input type=""checkbox"" name=""Corp_SI"" value="""&Array_List(0,i)&""" "&get_check(array_list(0,i),corp_si)&">"&Array_List(1,i)&"&nbsp;&nbsp;&nbsp;&nbsp;"
		Next 
	End If 
End Sub 
Function get_check(d_id,corp_si)
	If IsNull(corp_si) Then 
		get_check = ""
		Exit Function 
	End If 
	corp_si_array = Split(corp_si,",")
	For xx=0 To UBound(corp_si_array)
		If CStr(d_id)=CStr(Trim(corp_si_array(xx))) Then 
			get_check = "checked"
			Exit Function 
			
		End If 

	Next 
	get_check = ""

End Function

Dim UserName		
Dim News_Title		
Dim News_Content	
Dim News_Use_Day	

Sub Corp_Sale_News_Post()
	
	News_Title	 = reform("News_Title")	
	News_Content = reform("News_Content")	
	News_Use_Day = reform("News_Use_Day")
	sql = "INSERT INTO Corp_Sale_News( " &_
		"UserName"&_

		",News_Title"&_
		",News_Content"&_
		",News_Use_Day"&_
		",Update_Date"&_

		") VALUES( " &_
		"'"&Session("username")&"'"&_

		",'"&News_Title&"'"&_
		",'"&News_Content&"'"&_
		",'"&News_Use_Day&"'"&_
		",'"&Update_Date&"'"&_
		
		")"

    conn.execute(sql)

	AlertBox "信息增加成功！","Corp_Sale_News_List.asp"

End Sub 
Sub Corp_Sale_News_Del()

	Info_ID = Requery("ID")
	Call Check_IsNumeric(Info_ID)

	sql = "DELETE FROM  Corp_Sale_News WHERE ID = "&Info_ID &" AND UserName='"&Session("username")&"'"
	
    conn.execute(sql)

	AlertBox "删除成功","Corp_Sale_News_List.asp"

End Sub 
Sub Get_Corp_Sale_News_Info()
	ID = requery("ID")

	Call Check_IsNumeric(ID)


	sql = "SELECT * FROM Corp_Sale_News WHERE ID = "&ID &" AND UserName='"&Session("username")&"'"
	
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		News_Title	 = rs("News_Title")	
		News_Content = rs("News_Content")	
		News_Use_Day = rs("News_Use_Day")

	End If
	rs.close

End Sub

Sub Corp_Sale_News_Update()
	ID		= reform("ID") 
	Call Check_IsNumeric(ID)

	News_Title	 = reform("News_Title")	
	News_Content = reform("News_Content")	
	News_Use_Day = reform("News_Use_Day")


	Sql = "UPDATE Corp_Sale_News SET "&_
		" News_Title='"&News_Title&"'"&_		
		",News_Content='"&News_Content&"'"&_			
		",News_Use_Day='"&News_Use_Day&"'"&_		

		" WHERE ID = "&ID &" AND UserName='"&Session("username")&"'"

    conn.execute(sql)


	On Error Resume Next

    conn.execute(sql)

	if err.number =0 then  
		AlertBox "信息修改成功！","Corp_Sale_News_List.asp"
	else 
		AlertBox "信息修改失败！","javascript:history.go(-1)"
	end if
End Sub 


Dim Info_Type		
Dim Info_Title		
Dim Info_Content	
Dim Info_Link		
Dim Info_Tel		

Sub Gq_Info_Del()

	Info_ID = Requery("ID")
	Call Check_IsNumeric(Info_ID)

	sql = "DELETE FROM  Member_Info WHERE ID = "&Info_ID &" AND UserName='"&Session("username")&"'"
	
    conn.execute(sql)

	AlertBox "删除成功","Gq_Info_List.asp"

End Sub 
Sub Get_Gq_Info()
	ID = requery("ID")

	Call Check_IsNumeric(ID)


	sql = "SELECT * FROM Member_Info WHERE ID = "&ID &" AND UserName='"&Session("username")&"'"
	
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		Info_Type =rs("Info_Type")		
		Info_Title =rs("Info_Title")		
		Info_Content =rs("Info_Content")	
		Info_Link =rs("Info_Link")		
		Info_Tel =rs("Info_Tel")		

	End If
	rs.close

End Sub
'企业招聘发布
Sub Gq_Info_Post()

	Info_Type		= Reform("Info_Type")		
	Info_Title		= Reform("Info_Title")		
	Info_Content	= Reform("Info_Content")	
	Info_Link		= Reform("Info_Link")		
	Info_Tel		= Reform("Info_Tel")		

	UserName		= Session("username")
	Info_Add_Date   = Now()
	Info_Add_IP		= get_clientip()

	sql = "INSERT INTO Member_Info( " &_
		"UserName " &_
		",Info_Type"&_		
		",Info_Title"&_			
		",Info_Content"&_			
		",Info_Link"&_		
		",Info_Tel"&_		

		",Info_Add_Date"&_		
		",Info_Add_IP"&_		

		") VALUES( " &_
		" '" & UserName & "'" &_

		",'"&Info_Type&"'"&_		
		",'"&Info_Title&"'"&_			
		",'"&Info_Content&"'"&_		

		",'"&Info_Link&"'"&_		
		",'"&Info_Tel&"'"&_			

		",'"&Info_Add_Date&"'"&_		
		",'"&Info_Add_IP&"'"&_		

		")"

	'writebr sql
	'On Error Resume Next

    conn.execute(sql)

	if err.number =0 then  
		AlertBox "信息增加成功！","Gq_Info_List.asp"
	else 
		AlertBox "信息增加失败！","javascript:history.go(-1)"
	end if
End Sub 
Sub Gq_Info_Update()
	ID		= reform("ID") 
	Call Check_IsNumeric(ID)

	Info_Type		= Reform("Info_Type")		
	Info_Title		= Reform("Info_Title")		
	Info_Content	= Reform("Info_Content")	
	Info_Link		= Reform("Info_Link")		
	Info_Tel		= Reform("Info_Tel")		


	Sql = "UPDATE Member_Info SET "&_
		" Info_Type='"&Info_Type&"'"&_		
		",Info_Title='"&Info_Title&"'"&_		
		",Info_Content='"&Info_Content&"'"&_	
		",Info_Link='"&Info_Link&"'"&_		
		",Info_Tel='"&Info_Tel&"'"&_		

		" WHERE ID = "&ID &" AND UserName='"&Session("username")&"'"

    conn.execute(sql)


	On Error Resume Next

    conn.execute(sql)

	if err.number =0 then  
		AlertBox "信息修改成功！","Gq_Info_List.asp"
	else 
		AlertBox "信息修改失败！","javascript:history.go(-1)"
	end if
End Sub 
Sub Get_Person_Service_Item(UserName)
	Sql = "SELECT dsi_id,dsi_name FROM uvw_dic_item  WHERE di_name='家政人才服务项目'" 
	Array_List = GetRsRows(Sql)
	If IsArray(Array_List) Then 
		For i=0 To UBound(Array_List,2)
			Service_Item_ID = Array_List(0,i)
			dsi_name		= Array_List(1,i)
			Response.Write Get_Service_Item_Check(UserName,Service_Item_ID)&dsi_name&" "
		Next 
	End If 
End Sub 
Function Get_Service_Item_Check(UserName,Service_Item_ID)
	Sql = "SELECT ID FROM Member_Person_Service_Item WHERE UserName='"&UserName&"' AND Service_Item_ID=" &Service_Item_ID
	Array_List = GetRsRows(Sql)
	If IsArray(Array_List) Then 
		s_str = "<input type=""checkbox"" name=""Service_Item"" checked value="""&Service_Item_ID&""">" 
	Else
		s_str = "<input type=""checkbox"" name=""Service_Item""  value="""&Service_Item_ID&""">"
	End If 
	Get_Service_Item_Check = s_str
End Function 
Sub Update_Service_Item(UserName,Service_Item)
	If Service_Item="" Or IsNull(Service_Item) Then 
		Exit Sub 
	End If 
	conn.execute("UPDATE  Member_Person_Service_Item SET UseFlag=0 WHERE UserName='"&UserName&"'")
	Service_Item_Array = Split(Service_Item,",")
	For i=0 To UBound(Service_Item_Array)
		Service_Item_ID = Trim(Service_Item_Array(i))
		If Get_FirstValue("SELECT ID FROM Member_Person_Service_Item WHERE UserName='"&UserName&"' AND Service_Item_ID="&Service_Item_ID)<>"" Then 
			conn.execute("UPDATE  Member_Person_Service_Item SET UseFlag=1 WHERE UserName='"&UserName&"' AND Service_Item_ID="&Service_Item_ID)
		Else 
			conn.execute("INSERT INTO Member_Person_Service_Item( UserName,Service_Item_ID,UseFlag) VALUES('"&UserName&"',"&Service_Item_ID&",1)")
		End If 
	Next 
	conn.execute("DELETE FROM   Member_Person_Service_Item WHERE  UseFlag=0 AND  UserName='"&UserName&"'")

End Sub
Sub Get_Corp_Person_Service_Item(Corp_Person_ID)
	Sql = "SELECT dsi_id,dsi_name FROM uvw_dic_item  WHERE di_name='家政人才服务项目'" 
	Array_List = GetRsRows(Sql)
	If IsArray(Array_List) Then 
		For i=0 To UBound(Array_List,2)
			Service_Item_ID = Array_List(0,i)
			dsi_name		= Array_List(1,i)
			Response.Write Get_Corp_Person_Service_Item_Check(Corp_Person_ID,Service_Item_ID)&dsi_name&" "
		Next 
	End If 
End Sub 
Function Get_Corp_Person_Service_Item_Check(Corp_Person_ID,Service_Item_ID)
	If IsNumeric(Corp_Person_ID) Then 
		Sql = "SELECT ID FROM Corp_Person_Service_Item WHERE Corp_Person_ID="&Corp_Person_ID&" AND Service_Item_ID=" &Service_Item_ID
		Array_List = GetRsRows(Sql)
		If IsArray(Array_List) Then 
			s_str = "<input type=""checkbox"" name=""Service_Item"" checked value="""&Service_Item_ID&""">" 
		Else
			s_str = "<input type=""checkbox"" name=""Service_Item""  value="""&Service_Item_ID&""">"
		End If 
	Else
		s_str = "<input type=""checkbox"" name=""Service_Item""  value="""&Service_Item_ID&""">"
	End If 
	Get_Corp_Person_Service_Item_Check = s_str
End Function 
Sub Corp_Person_Update_Service_Item(Corp_Person_ID,Service_Item)
	If Service_Item="" Or IsNull(Service_Item) Then 
		Exit Sub 
	End If 
	conn.execute("UPDATE  Corp_Person_Service_Item SET UseFlag=0 WHERE Corp_Person_ID="&Corp_Person_ID)
	Service_Item_Array = Split(Service_Item,",")
	For i=0 To UBound(Service_Item_Array)
		Service_Item_ID = Trim(Service_Item_Array(i))
		If Get_FirstValue("SELECT ID FROM Corp_Person_Service_Item WHERE Corp_Person_ID="&Corp_Person_ID&" AND Service_Item_ID="&Service_Item_ID)<>"" Then 
			conn.execute("UPDATE  Corp_Person_Service_Item SET UseFlag=1 WHERE Corp_Person_ID="&Corp_Person_ID&" AND Service_Item_ID="&Service_Item_ID)
		Else 
			conn.execute("INSERT INTO Corp_Person_Service_Item( Corp_Person_ID,Service_Item_ID,UseFlag) VALUES("&Corp_Person_ID&","&Service_Item_ID&",1)")
		End If 
	Next 
	conn.execute("DELETE FROM   Corp_Person_Service_Item WHERE  UseFlag=0 AND  Corp_Person_ID="&Corp_Person_ID)

End Sub 
%>